﻿using System;
using System.Runtime.Serialization;
using YawetagDemo.Framework.Data;

namespace YawetagDemo.Framework.Server.Data
{
    [DataContract]
    public class WCFAlbumRankingItem : IAlbumRankingItem
    {
        private WCFAlbumRankingItem(IAlbumRankingItem albumRanking)
        {
            BandID = albumRanking.BandID;
            BandName = albumRanking.BandName;

            AlbumID = albumRanking.AlbumID;
            Name = albumRanking.Name;
            ReleaseDate = albumRanking.ReleaseDate;

            Stars = albumRanking.Stars;
        }

        public static WCFAlbumRankingItem Get(IAlbumRankingItem albumRanking)
        {
            return new WCFAlbumRankingItem(albumRanking);
        }

        [DataMember] public int BandID { get; private set; }
        [DataMember] public string BandName { get; private set; }

        [DataMember] public int AlbumID { get; private set; }
        [DataMember] public string Name { get; private set; }
        [DataMember] public DateTime ReleaseDate { get; private set; }

        [DataMember] public decimal Stars { get; private set; }
    }
}
